//
//  lunboView.m
//  OfferJob
//
//  Created by 河南动力无限科技有限公司 on 17/7/13.
//  Copyright © 2017年 郑州动力无限科技. All rights reserved.
//

#import "lunboView.h"
#import "UIViewAdditions.h"
#import "FXTHeader.h"

@interface lunboView()<SDCycleScrollViewDelegate>
@property (nonatomic,strong) UIView *bgView;
@end

@implementation lunboView
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupNewView];
    }
    return self;
}
-(void)setupNewView{
    
    
    _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
    _bgView.backgroundColor = [UIColor clearColor];
    [self addSubview:_bgView];
    
    
}
-(void)setBannerImageArray:(NSMutableArray *)bannerImageArray{
    _bannerImageArray = bannerImageArray;
    [_bannerScrolleView removeFromSuperview];
    _bannerScrolleView = nil;
    _bannerScrolleView = [SDCycleScrollView cycleScrollViewWithFrame:_bgView.frame delegate:self placeholderImage:[UIImage imageNamed:@"icon_bjj"]];
    _bannerScrolleView.currentPageDotImage = [UIImage imageNamed:@"home_banner01"];
    _bannerScrolleView.pageDotImage = [UIImage imageNamed:@"home_banner02"];
    _bannerScrolleView.imageURLStringsGroup = _bannerImageArray;
    [_bgView addSubview:_bannerScrolleView];
}
/** 点击图片回调 */
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index{
    if (_delegate && [_delegate respondsToSelector:@selector(BannerCollectionReusableViewDelegatecycledidSelectItemAtIndex:)]) {
        [_delegate BannerCollectionReusableViewDelegatecycledidSelectItemAtIndex:index];
    }
}


@end
